

// 处理来自 Content 的消息
const handler:any = async (req, res) => {
    console.log("收到消息:", req.name, req.body)
    
    // 处理不同消息类型
    if (req.name === "contentToBackground") {
      const data = await processContentMessage(req.body)
      res.send({ status: "success", data })
    }
  }
  
  const processContentMessage = async (body: any) => {
    return {
      processed: true,
      timestamp: new Date().toISOString(),
      originalData: body
    }
  }
  
  export default handler